#include <iostream>

using namespace std;

typedef struct _TREE_NODE
{
	int data;
	struct _TREE_NODE* parent;
	struct _TREE_NODE* prev;
	struct _TREE_NODE* next;
	struct _TREE_NODE* left;
	struct _TREE_NODE* right;
}TREE_NODE;

void set_link_for_insert(TREE_NODE* pParent, TREE_NODE* pNode)
{
	if(NULL == pParent || NULL == pNode)
		return;

	if(pNode = pParent->left){
		pNode->prev = pParent->prev;
		if(pParent->prev)
			pParent->prev->next = pNode;
		pNode->next = pParent;
		pParent->prev = pNode;
	}else{
		pNode->next = pParent->next;
		if()
	}
}



int main()
{
    cout << "Hello world!" << endl;
    return 0;
}
